home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / c / library / bcfamily / source / dosxopen.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-12  |  908 b   |  38 lines

  1. //
  2. //      *******************************************************************
  3. //        JdeBP C++ Library Routines          General Public Licence v1.00
  4. //            Copyright (c) 1991,1992     Jonathan de Boyne Pollard
  5. //      *******************************************************************
  6. //
  7. // Part of FamAPI.LIB
  8. //
  9.  
  10. #include "famapi.h"
  11. #include "dosdos.h"
  12.  
  13. //
  14. //    Extended open (DOS 4.0 and later)
  15. //
  16. USHORT _APICALL
  17. DosDosXOpen    ( const char far *FileName,
  18.               unsigned short far *FileHandle,
  19.               unsigned int far *ActionTaken,
  20.               unsigned int Attribute,
  21.               unsigned int OpenFlags,
  22.               unsigned int OpenMode)
  23. {
  24.     asm push ds ;
  25.     _DS = FP_SEG(FileName) ;
  26.     _SI = FP_OFF(FileName) ;
  27.     _DX = OpenFlags & 0xff ;
  28.     _CX = Attribute ;
  29.     _BX = OpenMode ;
  30.     _AX = 0x6c00 ;
  31.     Dos3Call() ;
  32.     asm pop ds ;
  33.     if (_FLAGS & 0x0001) return _AX ;
  34.     *FileHandle = _AX ;
  35.     *ActionTaken = _CX ;
  36.     return NO_ERROR ;
  37. }
  38.